package com.lekang.controller;

import com.lekang.dto.ElderlyRoomInfoDTO;
import com.lekang.service.IElderlyRoomService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;

@RestController
public class ElderlyRoomController {

    @Autowired
    private IElderlyRoomService elderlyRoomService;

    /**
     * 获取老人关联的床位、房间、房型及微信绑定信息
     * @param wxUserId 微信用户ID（可选，不填则查询所有）
     * @return 联查结果
     */
    @GetMapping("/elderly/room/info")
    public List<ElderlyRoomInfoDTO> getElderlyRoomInfo(
            @RequestParam(required = false) Long wxUserId) {
        return elderlyRoomService.getElderlyRoomInfo(wxUserId);
    }
}